<?php // logout.php 
session_start(); 
unset($_SESSION); 
// you may want to delete the session cookie 
if (isset($_COOKIE[session_name()])) { 
  setcookie(session_name(), '', time()-60); 
} 

session_destroy(); 
echo 'You have been logged out.'; 
?>